home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 24 / Amiga Format AFCD24 (Feb 1998, Issue 108).iso / -in_the_mag- / emulation / amiga / uae-0.7.0b2 / src / include / xwin.h < prev    next >
C/C++ Source or Header  |  1998-01-20  |  3KB  |  96 lines

  1.  /*
  2.   * UAE - The Un*x Amiga Emulator
  3.   *
  4.   * Interface to the graphics system (X, SVGAlib)
  5.   *
  6.   * Copyright 1995-1997 Bernd Schmidt
  7.   */
  8.  
  9. typedef long int xcolnr;
  10.  
  11. typedef int (*allocfunc_type)(int, int, int, xcolnr *);
  12.  
  13. extern xcolnr xcolors[4096];
  14.  
  15. extern int buttonstate[3];
  16. extern int newmousecounters;
  17. extern int lastmx, lastmy;
  18.  
  19. extern int graphics_setup(void);
  20. extern int graphics_init(void);
  21. extern void graphics_leave(void);
  22. extern void handle_events(void);
  23. extern void setup_brkhandler(void);
  24.  
  25. extern void flush_line(int);
  26. extern void flush_block(int, int);
  27. extern void flush_screen(int, int);
  28.  
  29. extern int debuggable(void);
  30. extern int needmousehack(void);
  31. extern void togglemouse(void);
  32. extern void LED(int);
  33.  
  34. extern unsigned long doMask(int p, int bits, int shift);
  35. extern void setup_maxcol(int);
  36. extern void alloc_colors256(int (*)(int, int, int, xcolnr *));
  37. extern void alloc_colors64k(int, int, int, int, int, int);
  38. extern void setup_greydither(int bits, allocfunc_type allocfunc);
  39. extern void setup_greydither_maxcol(int maxcol, allocfunc_type allocfunc);
  40. extern void setup_dither(int bits, allocfunc_type allocfunc);
  41. extern void DitherLine(uae_u8 *l, uae_u16 *r4g4b4, int x, int y, uae_s16 len, int bits) ASM_SYM_FOR_FUNC("DitherLine");
  42.  
  43. struct vidbuf_description
  44. {
  45.     char *bufmem; /* Pointer to either the video memory or an area as large which is used as a buffer. */
  46.     char *linemem; /* Pointer to a single line in memory to draw into. If NULL, use bufmem. */
  47.     int rowbytes; /* Bytes per row in the memory pointed at by bufmem. */
  48.     int pixbytes; /* Bytes per pixel. */
  49.     int width;
  50.     int height;
  51.     int maxblocklines; /* Set to 0 if you want calls to flush_line after each drawn line, or the number of
  52.             * lines that flush_block wants to/can handle (it isn't really useful to use another
  53.             * value than maxline here). */
  54.     int can_double; /* Set if the high part of each entry in xcolors contains the same value
  55.              * as the low part, so that two pixels can be drawn at once. */
  56. };
  57.  
  58. extern struct vidbuf_description gfxvidinfo;
  59.  
  60. /* For ports using tui.c, this should be built by graphics_setup(). */
  61. extern struct bstring *video_mode_menu;
  62. extern void vidmode_menu_selected(int);
  63.  
  64. /* Some definitions that are useful for multithreaded setups. */
  65.  
  66. /* If frame_do_semup is nonzero, custom.c will do a sem_post on frame_sem
  67.  * the next time it checks the contents of inhibit_frame.  That way, a
  68.  * thread set a bit in inhibit_frame and wait until custom.c has stopped
  69.  * drawing.
  70.  * gui_sem is currently unused.
  71.  * ihf_sem protects modifications of inhibit_frame.
  72.  */
  73. extern uae_sem_t frame_sem, gui_sem, ihf_sem;
  74. extern volatile int inhibit_frame;
  75. extern volatile int frame_do_semup;
  76.  
  77. static __inline__ void set_inhibit_frame (int bit)
  78. {
  79.     uae_sem_wait (&ihf_sem);
  80.     inhibit_frame |= 1 << bit;
  81.     uae_sem_post (&ihf_sem);
  82. }
  83. static __inline__ void clear_inhibit_frame (int bit)
  84. {
  85.     uae_sem_wait (&ihf_sem);
  86.     inhibit_frame &= ~(1 << bit);
  87.     uae_sem_post (&ihf_sem);
  88. }
  89. static __inline__ void toggle_inhibit_frame (int bit)
  90. {
  91.     uae_sem_wait (&ihf_sem);
  92.     inhibit_frame ^= ~(1 << bit);
  93.     uae_sem_post (&ihf_sem);
  94. }
  95.  
  96.